package com.bfl.sa.sys.resource.converter;

import com.bfl.sa.sys.resource.entity.Resource;
import com.bfl.sa.sys.resource.service.ResourceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.converter.Converter;

public class ResourceConverter implements Converter<String, Resource> {

    @Autowired
    private ResourceService resourceService;

    @Override
    public Resource convert(String id) {
        return resourceService.findOne(Long.parseLong(id));
    }
}
